home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / Direct3D / EnvMapping / SphereMap / readme.txt < prev    next >
Text File  |  2001-10-10  |  3KB  |  57 lines

  1. F//-----------------------------------------------------------------------------
  2. // Name: SphereMap Direct3D Sample
  3. // 
  4. // Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
  5. //-----------------------------------------------------------------------------
  6.  
  7.  
  8. Description
  9. ===========
  10.    The SphereMap sample demonstrates an enviroment-mapping technique called 
  11.    sphere-mapping. Environment-mapping is a technique in which the environment
  12.    surrounding a 3D object (such as the lights, etc.) are put into a texture
  13.    map, so that the object can have complex lighting effects without expensive
  14.    lighting calculations.
  15.  
  16.    Note that not all cards support all features for all the various environment
  17.    mapping techniques (such as cubemapping and projected textures). For more
  18.    information on environment mapping, cubemapping, and projected textures, 
  19.    refer to the DirectX SDK documentation. 
  20.  
  21.  
  22. Path
  23. ====
  24.    Source:     DXSDK\Samples\Multimedia\D3D\EnvMapping\SphereMap
  25.    Executable: DXSDK\Samples\Multimedia\D3D\Bin
  26.  
  27.  
  28. User's Guide
  29. ============
  30.    The following keys are implemented. The dropdown menus can be used for the
  31.    same controls.
  32.       <Enter>     Starts and stops the scene
  33.       <Space>     Advances the scene by a small increment
  34.       <F2>        Prompts user to select a new rendering device or display mode
  35.       <Alt+Enter> Toggles between fullscreen and windowed modes
  36.       <Esc>       Exits the app.
  37.  
  38.  
  39. Programming Notes
  40. =================
  41.    Sphere-mapping uses a precomputed (at model time) texture map which contains
  42.    the entire environment as reflected by a chrome sphere. The idea is to
  43.    consider each vertex, compute it's normal, find where the normal matches up
  44.    on the chrome sphere, and then assign that texture coordinate to the vertex.
  45.  
  46.    The math involves computations for each vertex for every frame.  This sample 
  47.    uses a vertex shader to perform these calculations.  Basically, the vertex 
  48.    shader computes a camera-space reflection vector, given the camera position, 
  49.    vertex position, and vertex normal.  Then, it computes the half-angle vector 
  50.    between the reflection vector, and the view direction.  This vector can then 
  51.    be scaled and offset by 0.5 to index into the spheremap texture.
  52.  
  53.    This sample makes use of common DirectX code (consisting of helper functions,
  54.    etc.) that is shared with other samples on the DirectX SDK. All common
  55.    headers and source code can be found in the following directory:
  56.       DXSDK\Samples\Multimedia\Common
  57.